<!--{template admin/header}-->
<!--{template admin/leftside}-->
<body id="homepage">
    <div id="breadcrumb">
        <ul>
            <li><img src="static/img/icons/icon_breadcrumb.png" alt="Location" /></li>
            <li><strong>位置:</strong></li>
            <li><a href="admin.php">主页</a> - 女生申请列表</li>
        </ul>
    </div>
    <div id="rightside" class="user_ability">
        <div class="contentcontainer">
            <div class="headings altheading">
             <h3>{$statusInfo[$status]}列表,共{$totalNumber}条记录</h3>
            </div>
            <div class="contentbox">
                <div class="extrabottom">
                    <form method="get" class="form-inline" role="form" action="admin.php">
                    	 <input type="hidden" name="ac" value="femaleAuth">
                        <div class="input-prepend">
							<span class="add-on">用户</span>
							<input class="span2" id="prependedInput" type="text" placeholder="UID" name="uuid" value="" >
						</div>
						<select name="status" class="span2" >
						    <option value="1" $style['status'][1]>待认证</option>
							<option value="2" $style['status'][2]>拉黑认证</option>
                            <option value="0" $style['status'][0]>认证通过</option>                          
                        </select>                      
                        <select name="length" class="span2" >
                            <option value="20"  $style['length'][20]>每页显示20个</option>
                            <option value="50"  $style['length'][50]>每页显示50个</option>
                            <option value="100" $style['length'][100]>每页显示100个</option>
                        </select> 
                       <div class="input-prepend">
							<span class="add-on">页数</span>
							<input class="span1" id="prependedInput" type="text" placeholder="去到第几页" name="page" value="" >
						</div>                     
                       <button type="submit" name="submited" class="btn btn-large">点击查询</button>
                    </form>
                </div>
           
                <div style="clear: both;"></div>
                <table width="100%"  class="table table-striped">
                    <thead>
                        <tr>
                         	<th>UID</th>
							<th>昵称</th>
							<th>音频</th>
							<th>等级</th>
							<th>状态</th>
							<th>申请时间</th>							
							<th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <!--{if !empty($list)}-->
							<!--{loop $list $value}-->									
							<tr id="tr_{$value['uid']}">
								<td>{$value['uid']}</td>
								<td><a href="admin.php?ac=user_profile&uid={$value[uid]}"><!--{$value[user][nickname]}--></a></td>
								<td>
								    <audio preload="auto" controls >
											<source src="{$value['auth_url']}" />
									</audio>
								</td>
								<td>					
								<!--{$value['user']['level']}-->
								</td>
								<td>
									<!--{eval interpretationState($value['status'])}-->
								</td>
								<td>
									<!--{date('y/m/d H:i',$value['applytime'])}-->
								</td>								                        	
                            	<td>
	                            	<div class="btn-group">
										  <button class="btn">管理</button>
										  <button class="btn dropdown-toggle" data-toggle="dropdown">
										    <span class="caret"></span>
										  </button>
										  <ul class="dropdown-menu">
										  <!--{if $value['status']==2}-->
										  	 <li><a href="javascript:;" class="permit" data-bodyuid="{$value['uid']}" name=0 >添加认证</a></li>		
										     <li><a href="javascript:;" class="reapply" data-bodyuid="{$value['uid']}">忽略认证</a></li>
										  <!--{elseif $value['status']==0}-->
										  	 <li><a href="javascript:;" class="permit" data-bodyuid="{$value['uid']}" name=2 >拉黑认证</a></li>		
										     <li><a href="javascript:;" class="reapply" data-bodyuid="{$value['uid']}">忽略认证</a></li>
										  <!--{else}-->
										  	 <li><a href="javascript:;" class="permit" data-bodyuid="{$value['uid']}" name=0 >添加认证</a></li>
										     <li><a href="javascript:;" class="permit" data-bodyuid="{$value['uid']}" name=2 >拉黑认证</a></li>		
										     <li><a href="javascript:;" class="reapply" data-bodyuid="{$value['uid']}">忽略认证</a></li>
										  <!--{/if}-->		   
										  </ul>
									</div>
                            	</td>
                        	</tr>
                        	<!--{/loop}-->
                        <!--{/if}-->
                    </tbody>
                </table>
            </div>
        </div>
		 <div class="extrabottom">
                    <div class="bulkactions"> $pageHtml </div>
         </div>
    </div>
<!--{template admin/footer}-->
<script type="text/javascript" language="javascript">
		    $(document).on('click','.permit',function(){				
				status=$(this).attr('name');	
				var data=$(this).data();
				var tritem="tr_"+data.bodyuid;
				var uuid=data.bodyuid;						
		
				$.ajax({
					type:'POST',
					url:'admin.php?ac=femaleAuth&op=permit',
				    data:{'permit':status,'uuid':uuid},
				    success:function(data){				
				    		console.log(data);
				    		if(data=="true"){
				    			$('#'+tritem).fadeOut('normal');
				    		}else{
				    			alert('操作失败');
				    		}
				    }
				})     
		});
	    $(document).on('click','.reapply',function(){	
	    	var data=$(this).data();
			var tritem="tr_"+data.bodyuid;
			var uuid=data.bodyuid;		
	    	 $.ajax({
					type:'POST',
					url:'admin.php?ac=femaleAuth&op=reapply',
				    data:{'uuid':uuid},
				    success:function(data){								    	
				    		if(data==1){
				    			$('#'+tritem).fadeOut('normal');
				    		}else{
				    			alert('操作失败');	
				    		}
				    }
				})       
		})  
</script>